<!doctype html>
<html lang="zh">
  <head>
    <style>
      /* .gray {
      filter: grayscale(85%);
      -webkit-filter: grayscale(85%);
      -moz-filter: grayscale(85%);
      -ms-filter: grayscale(85%);
      -o-filter: grayscale(85%);
      filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
      filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=0.85);
      filter: gray;
      -webkit-filter: grayscale(0.85)
    } */
    </style>
    <meta http-equiv="keywords" content="加油,限号,油价" />
    <meta http-equiv="description" content="加油记录，实时天气，今日限号" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>加油宝</title>
    <link rel="icon" type="image/x-icon" href="./static/favicon.ico" />
    <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=yes"> -->
    <title>refuel</title>
    <script
      type="text/javascript"
      src="https://cdn.jsdelivr.net/npm/js-base64@3.6.0/base64.min.js"
    ></script>
    <script
      type="text/javascript"
      src="http://api.map.baidu.com/api?v=3.0&ak=7latSy7K5mjlPBsGb2VlqLzKL8MLoRWB"
    ></script>
    <!-- <script type="text/javascript" src="./static/js/idle.js" defer></script> -->
    <% if(process.env.NODE_ENV==='development' ) {%>
    <script>
      // console.log("development");
      window.onload = function () {
        window.testArray = [];
        //首页加载时间
        let firstScreen =
          window.performance.timing.domComplete - window.performance.timing.navigationStart;
        //首页白屏时间
        let blackScreen =
          window.performance.timing.responseStart - window.performance.timing.navigationStart;
        //首页http时间
        let httpTime =
          window.performance.timing.responseEnd - window.performance.timing.responseStart;
        console.log('firstScreen', firstScreen);
        console.log('blackScreen', blackScreen);
        console.log('httpTime', httpTime);
        let timeStr;
        let rewriteHis = function (type) {
          let origin = window.history[type];
          return function () {
            let rs = origin.apply(this, arguments);
            let e = new Event(type.toLocaleLowerCase());
            e.arguments = arguments;
            window.dispatchEvent(e);
            return rs;
          };
        };

        window.history.pushState = rewriteHis('pushState');

        window.history.replaceState = rewriteHis('replaceState');

        window.addEventListener('onload', e => {
          timeStr = new Date().getTime();
        });

        window.addEventListener('popstate', () => {
          let t = new Date().getTime() - timeStr;
          timeStr = new Date().getTime();
          console.log('待了时长popstate：' + t);
        });

        window.addEventListener('pushstate', () => {
          let t = new Date().getTime() - timeStr;
          timeStr = new Date().getTime();
          console.log('待了时长pushstate：' + t);
        });

        window.addEventListener('replacestate', () => {
          let t = new Date().getTime() - timeStr;
          timeStr = new Date().getTime();
          console.log('待了时长replacestate：' + t);
        });
      };
    </script>
    <%} else {%>
    <script>
      // console.log("production");
      var url = '192.168.0.1';
      window.onload = function () {
        window.testArray = [];
        //首页加载时间
        let firstScreen =
          window.performance.timing.domComplete - window.performance.timing.navigationStart;
        //首页白屏时间
        let blackScreen =
          window.performance.timing.responseStart - window.performance.timing.navigationStart;
        //首页http时间
        let httpTime =
          window.performance.timing.responseEnd - window.performance.timing.responseStart;
        console.log('firstScreen', firstScreen);
        console.log('blackScreen', blackScreen);
        console.log('httpTime', httpTime);
        let timeStr;
        let rewriteHis = function (type) {
          let origin = window.history[type];
          return function () {
            let rs = origin.apply(this, arguments);
            let e = new Event(type.toLocaleLowerCase());
            e.arguments = arguments;
            window.dispatchEvent(e);
            return rs;
          };
        };

        window.history.pushState = rewriteHis('pushState');

        window.history.replaceState = rewriteHis('replaceState');

        window.addEventListener('onload', e => {
          timeStr = new Date().getTime();
        });

        window.addEventListener('popstate', () => {
          let t = new Date().getTime() - timeStr;
          timeStr = new Date().getTime();
          console.log('待了时长popstate：' + t);
        });

        window.addEventListener('pushstate', () => {
          let t = new Date().getTime() - timeStr;
          timeStr = new Date().getTime();
          console.log('待了时长pushstate：' + t);
        });

        window.addEventListener('replacestate', () => {
          let t = new Date().getTime() - timeStr;
          timeStr = new Date().getTime();
          console.log('待了时长replacestate：' + t);
        });
      };
    </script>
    <%}%>
  </head>

  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
    <script>
      // if (navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Trident") != -1) {
      //   window.location.href = "./static/html/unsupport-browser.html";
      // }
      // document.oncontextmenu = function () { return false; };
      // document.onselectstart = function () { return false; };
      // document.oncopy = function () { return false; };
      // document.oncut = function () { return false; };
      // document.onpaste = function () { return false; };
    </script>
  </body>
</html>
